package com.blog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blog.pojo.Blog;
import com.blog.pojo.Favorite;
import com.blog.pojo.ThumbsUp;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-06-09 17:07
 * FileName: FavoriteMapper
 * Description: 博客收藏数据层
 */
@Repository(value = "FavoriteMapper")
@Mapper
public interface FavoriteMapper extends BaseMapper<Favorite> {
    /***
     * 取消收藏
     * @param blogId
     * @param uid
     * @return
     */
    int deleteFavorite(Long blogId,Long uid);

    /***
     * 查看用户收藏状态
     * @param blogId
     * @param uid
     * @return
     */
    Favorite selectFavorite(Long blogId,Long uid);

    /***
     * 根据用户id查询收藏博客
     * @param uid
     * @return
     */
    List<Blog> queryFavoriteBlogs(Long uid,String title);
}
